package dao;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import model.VilleAvion;

@Stateless
public class VilleAvionDaoImpl implements IVilleAvionDao {
	@PersistenceContext(unitName = "putravel")
	EntityManager em;

	@Override
	public VilleAvion find(String villename) {
		Query req = em
				.createQuery("select v from  VilleAvion v where v.nomVille=:nom");
		req.setParameter("nom", villename);
		return (VilleAvion) req.getSingleResult();
	}
}
